package com.example.administrator.bitmapcache;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

public class MainActivity extends AppCompatActivity {
    Button button;
    ImageView imageView;
    SimpleImageLoader simpleImageLoader;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        simpleImageLoader = SimpleImageLoader.getInstance(this);

        button = (Button)findViewById(R.id.button);
        imageView = (ImageView)findViewById(R.id.image);

        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                simpleImageLoader.displayImage(imageView,"http://www.makely.cn/mp/Upload/ads/2018-06/5b19011216a53.jpg");
            }
        });
    }
}
